package a.d;

import a.c.v;
import a.c.z;

public class f
{
  private static final double a = 0.001D;
  private double b;
  private z c;
  private double d;
  public static boolean e;
  
  public f(double paramDouble)
  {
    this(-1.797693134862316E+308D, 1.7976931348623157E+308D, paramDouble);
  }
  
  public f(double paramDouble1, double paramDouble2, double paramDouble3)
  {
    if (!w.e)
    {
      if (paramDouble1 > paramDouble2) {
        throw new IllegalArgumentException("min (" + paramDouble1 + ") must not be greater than max(" + paramDouble2 + ")");
      }
      this.c = new z();
    }
    a_ locala_1 = a_.a(paramDouble1, paramDouble3, 0.0D);
    locala_1.a = this.c.a(locala_1);
    a_ locala_2 = a_.a(paramDouble2, 0.0D, 0.0D);
    locala_2.a = this.c.b(locala_2);
  }
  
  public f(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
  {
    if (!bool)
    {
      if (paramDouble1 > paramDouble2) {
        throw new IllegalArgumentException("min (" + paramDouble1 + ") must not be greater than max(" + paramDouble2 + ")");
      }
      this.c = new z();
    }
    double d1 = (bool) || (paramDouble1 != paramDouble2) ? (paramDouble4 - paramDouble3) / (paramDouble2 - paramDouble1) : 0.0D;
    a_ locala_1 = a_.a(paramDouble1, paramDouble3, d1);
    locala_1.a = this.c.a(locala_1);
    a_ locala_2 = a_.a(paramDouble2, 0.0D, 0.0D);
    locala_2.a = this.c.b(locala_2);
  }
  
  static f a(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
  {
    f localf = new f();
    localf.c = new z();
    a_ locala_1 = a_.a(paramDouble1, paramDouble3, paramDouble4);
    locala_1.a = localf.c.a(locala_1);
    a_ locala_2 = a_.a(paramDouble2, 0.0D, 0.0D);
    locala_2.a = localf.c.b(locala_2);
    return localf;
  }
  
  private f() {}
  
  public f a(boolean paramBoolean1, boolean paramBoolean2)
  {
    boolean bool2 = w.e;
    boolean bool1 = w.d;
    z localz = new z();
    a_ locala_;
    if (paramBoolean2)
    {
      localObject = this.c.g().b();
      if (localObject != null) {
        if (paramBoolean1)
        {
          locala_ = a_.a(-d((v)localObject), -a((v)localObject), c((v)localObject));
          if (bool2) {
            break label123;
          }
          if (!bool1) {
            break label103;
          }
        }
      }
      label103:
      label123:
      do
      {
        locala_ = a_.a(-d((v)localObject), a((v)localObject), -c((v)localObject));
        locala_.a = localz.b(locala_);
        localObject = ((v)localObject).b();
        if (!bool1) {
          break;
        }
        if (bool2) {
          break label270;
        }
      } while (bool2);
      localObject = a_.a(-a(), 0.0D, 0.0D);
      ((a_)localObject).a = localz.b(localObject);
      if (!bool1) {}
    }
    else
    {
      localObject = this.c.f();
      do
      {
        if (localObject == null) {
          break;
        }
        if (paramBoolean1)
        {
          locala_ = a_.a(b((v)localObject), -a((v)localObject), -c((v)localObject));
          if (bool2) {
            continue;
          }
          if (!bool1) {}
        }
        else
        {
          locala_ = a_.a(b((v)localObject), a((v)localObject), c((v)localObject));
        }
        locala_.a = localz.b(locala_);
        localObject = ((v)localObject).a();
      } while (!bool1);
    }
    label270:
    Object localObject = new f();
    ((f)localObject).d = 0.0D;
    ((f)localObject).b = 0.0D;
    ((f)localObject).c = localz;
    return localObject;
  }
  
  public void a(double paramDouble1, double paramDouble2, double paramDouble3)
  {
    a(new f(paramDouble1, paramDouble2, paramDouble3), false, true);
  }
  
  public void b(double paramDouble1, double paramDouble2, double paramDouble3)
  {
    a(new f(paramDouble1, paramDouble2, paramDouble3), true, true);
  }
  
  public void a(f paramf)
  {
    this.c = paramf.c;
    this.d = paramf.d;
    this.b = paramf.b;
  }
  
  public void c(double paramDouble1, double paramDouble2, double paramDouble3)
  {
    b(paramDouble1, paramDouble2, paramDouble3, 0.0D);
  }
  
  public void b(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
  {
    boolean bool2 = w.e;
    boolean bool1 = w.d;
    v localv2;
    if (!bool2)
    {
      if (paramDouble1 > paramDouble2) {
        throw new IllegalArgumentException("min (" + paramDouble1 + ") must not be greater than max(" + paramDouble2 + ")");
      }
      if (bool2) {}
    }
    else if (paramDouble1 <= a())
    {
      if (!bool2)
      {
        if (paramDouble2 >= b()) {
          this.c.clear();
        }
      }
      else
      {
        locala_1 = a_.a(paramDouble1, paramDouble3, paramDouble4);
        locala_1.a = this.c.a(locala_1);
        locala_2 = a_.a(paramDouble2, 0.0D, 0.0D);
        locala_2.a = this.c.b(locala_2);
        this.b = (this.d = 0.0D);
        return;
      }
      localv1 = null;
      localv2 = d(paramDouble2);
      paramDouble2 -= this.d;
      paramDouble1 -= this.d;
      if (bool2) {
        break label195;
      }
      if (!bool1) {
        break label301;
      }
    }
    paramDouble1 -= this.d;
    label195:
    v localv1 = d(paramDouble1);
    if (paramDouble2 >= b())
    {
      localv2 = this.c.g();
      if (bool2) {
        break label308;
      }
      paramDouble2 -= this.d;
      if (!bool1) {}
    }
    else
    {
      localv2 = localv1.a();
      paramDouble2 -= this.d;
      do
      {
        do
        {
          if (((a_)localv2.c()).c > paramDouble2) {
            break;
          }
          if (bool2) {
            break label312;
          }
          localv2 = localv2.a();
          if (bool1) {
            break label310;
          }
        } while (!bool1);
      } while (bool2);
      localv2 = localv2.b();
    }
    label301:
    label308:
    paramDouble3 -= this.b;
    label310:
    label312:
    if (!bool2) {
      if (localv1 == localv2)
      {
        locala_1 = (a_)localv2.c();
        locala_2 = a_.a(paramDouble2, locala_1.a(paramDouble2), locala_1.d);
        locala_2.a = this.c.b(locala_2, locala_1.a);
        if (!bool2) {
          if (locala_1.c == paramDouble1)
          {
            locala_1.b = paramDouble3;
            if (bool2) {
              break label415;
            }
            locala_1.d = paramDouble4;
            if (!bool1) {
              break label436;
            }
          }
        }
        locala_3 = a_.a(paramDouble1, paramDouble3, paramDouble4);
        locala_3.a = this.c.b(locala_3, locala_1.a);
        return;
      }
    }
    label415:
    label436:
    if (!bool2) {
      if (localv1 == null)
      {
        locala_1 = a_.a(paramDouble1, paramDouble3, paramDouble4);
        if (bool2) {
          break label567;
        }
        localv1 = locala_1.a = this.c.a(locala_1);
        if (!bool1) {
          break label565;
        }
      }
    }
    a_ locala_1 = (a_)localv1.c();
    if (!bool2) {
      if (locala_1.c == paramDouble1)
      {
        locala_1.b = paramDouble3;
        if (bool2) {
          break label541;
        }
        locala_1.d = paramDouble4;
        if (!bool1) {
          break label565;
        }
      }
    }
    label541:
    a_ locala_2 = a_.a(paramDouble1, paramDouble3, paramDouble4);
    localv1 = locala_2.a = this.c.b(locala_2, locala_1.a);
    label565:
    label567:
    if (!bool2) {
      if (localv2 != null)
      {
        locala_1 = (a_)localv2.c();
        locala_1.b = locala_1.a(paramDouble2);
        locala_1.c = paramDouble2;
      }
    }
    locala_1 = (bool2) || (localv1.b() != null) ? (a_)localv1.b().c() : null;
    locala_2 = (a_)localv1.c();
    if (((bool2) || (locala_1 != null)) && ((bool2) || ((locala_1.d == locala_2.d) && (locala_1.a(locala_2.c) == locala_2.b)))) {
      localv1 = localv1.b();
    }
    a_ locala_3 = ((bool2) || (localv2 != null)) && ((bool2) || (localv2.b() != null)) ? (a_)localv2.b().c() : null;
    Object localObject = (bool2) || (localv2 != null) ? (a_)localv2.c() : null;
    if (!bool2) {
      if (localv2 != null)
      {
        if (bool2) {
          break label848;
        }
        if ((localv2 != this.c.g()) && ((bool2) || (locala_3 != null)) && ((bool2) || ((locala_3.d == localObject.d) && (locala_3.a(localObject.c) == localObject.b)))) {
          localv2 = localv2.a();
        }
      }
    }
    label848:
    localv1 = localv1.a();
    do
    {
      while (!bool1)
      {
        if (localv1 == localv2) {
          break;
        }
        this.c.h(localv1);
        localv1 = localv1.a();
      }
    } while (bool2);
  }
  
  public void a(double paramDouble)
  {
    this.b += paramDouble;
  }
  
  public void b(double paramDouble)
  {
    this.d += paramDouble;
  }
  
  public double a()
  {
    return ((a_)this.c.a()).c + this.d;
  }
  
  public double b()
  {
    return ((a_)this.c.d()).c + this.d;
  }
  
  public double c()
  {
    return c(a(), b());
  }
  
  public double d()
  {
    return b(a(), b());
  }
  
  public double c(double paramDouble)
  {
    v localv = d(paramDouble);
    return a(localv, paramDouble);
  }
  
  public double a(v paramv, double paramDouble)
  {
    a_ locala_ = (a_)paramv.c();
    return a(locala_, paramDouble);
  }
  
  public double a(a_ parama_, double paramDouble)
  {
    boolean bool = w.e;
    paramDouble -= this.d;
    if (!bool)
    {
      if (paramDouble - 0.01D <= parama_.a()) {
        if (bool) {
          break label88;
        }
      }
    }
    else {
      if (paramDouble + 0.01D >= parama_.c) {
        break label79;
      }
    }
    throw new IllegalArgumentException(paramDouble + " is outside of " + parama_);
    label79:
    label88:
    return parama_.a(paramDouble) + this.b;
  }
  
  public f b(f paramf)
  {
    if (!w.e) {
      if (this.c.size() < paramf.c.size())
      {
        localf = a(false, false);
        localf.d(paramf);
        return localf;
      }
    }
    f localf = paramf.a(false, false);
    localf.d(this);
    return localf;
  }
  
  public f c(f paramf)
  {
    if (!w.e) {
      if (this.c.size() < paramf.c.size())
      {
        localf = a(false, false);
        localf.e(paramf);
        return localf;
      }
    }
    f localf = paramf.a(false, false);
    localf.e(this);
    return localf;
  }
  
  public void d(f paramf)
  {
    a(paramf, true, false);
  }
  
  public void e(f paramf)
  {
    a(paramf, false, false);
  }
  
  private static w a(a_ parama_1, a_ parama_2)
  {
    boolean bool = w.e;
    if (!bool) {
      if (parama_1.d == parama_2.d) {
        return null;
      }
    }
    if (!bool)
    {
      if (parama_1.d == 0.0D)
      {
        d2 = parama_1.b;
        d3 = parama_2.c;
        d4 = parama_2.b;
        d5 = parama_2.d;
        d1 = d3 + (d2 - d4) / d5;
        return new w(d1, d2);
      }
      if (bool) {}
    }
    else if (parama_2.d == 0.0D)
    {
      d2 = parama_2.b;
      d3 = parama_1.c;
      d4 = parama_1.b;
      d5 = parama_1.d;
      d1 = d3 + (d2 - d4) / d5;
      return new w(d1, d2);
    }
    double d2 = Math.max(parama_1.c, parama_2.c);
    double d3 = parama_1.a(d2);
    double d4 = parama_2.a(d2);
    double d5 = d4 - d3;
    double d6 = parama_1.d - parama_2.d;
    if (!bool)
    {
      if (d5 == 0.0D) {
        return new w(d2, d3);
      }
      if (bool) {}
    }
    else if (d5 * d6 <= 0.0D)
    {
      return null;
    }
    double d1 = d2 + d5 / d6;
    return new w(d1, parama_1.a(d1));
  }
  
  private void a(f paramf, boolean paramBoolean1, boolean paramBoolean2)
  {
    boolean bool2 = w.e;
    boolean bool1 = w.d;
    if ((bool2) || (paramBoolean2)) {
      if (bool2) {}
    }
    int i = this.c.size() <= paramf.c.size() ? 1 : 0;
    double d1 = i != 0 ? paramf.d : this.d;
    double d2 = i != 0 ? paramf.b : this.b;
    double d3 = paramBoolean1 ? -1.797693134862316E+308D : 1.7976931348623157E+308D;
    double d4 = a();
    double d5 = paramf.a();
    double d6 = b();
    double d7 = paramf.b();
    z localz1 = this.c;
    z localz2 = paramf.c;
    Object localObject1 = localz1.f();
    v localv = localz2.f();
    z localz3 = new z();
    Object localObject2;
    if (!bool2) {
      if (d6 < d5)
      {
        if (i != 0) {
          if (localObject1 == null) {}
        }
        while (bool2)
        {
          localObject2 = (a_)((v)localObject1).c();
          localObject2.c += this.d - paramf.d;
          localObject2.b += this.b - paramf.b;
          if (bool2) {
            break label274;
          }
          localObject1 = ((v)localObject1).a();
          if (bool1) {
            break label272;
          }
          if (!bool1) {
            break;
          }
        }
        ((a_)localz1.d()).b = (d3 - d2);
        label272:
        label274:
        do
        {
          do
          {
            if (localv == null) {
              break label425;
            }
            localObject2 = localv;
            localv = localv.a();
            if ((!bool2) && (bool1)) {
              break label442;
            }
            if (!bool2)
            {
              if (!paramBoolean2) {
                break;
              }
              localz2.h((v)localObject2);
            }
            if (!bool2)
            {
              if (i == 0)
              {
                locala_3 = (a_)((v)localObject2).c();
                locala_3.b = (paramf.a((v)localObject2) - this.b);
                locala_3.c = (paramf.b((v)localObject2) - this.d);
              }
              localz1.a((v)localObject2);
            }
          } while (!bool1);
          a_ locala_3 = a_.a(paramf.b((v)localObject2) - d1, paramf.a((v)localObject2) - d2, paramf.c((v)localObject2));
          locala_3.a = localz1.b(locala_3);
        } while (!bool1);
        label425:
        this.d = d1;
        if (!bool2) {
          this.b = d2;
        }
        label442:
        return;
      }
    }
    if (!bool2) {
      if (d7 < d4)
      {
        ((a_)localz2.d()).b = (d3 - d2);
        do
        {
          double d9;
          do
          {
            if (localv == null) {
              break label630;
            }
            localObject2 = localv;
            localv = localv.a();
            if (bool1) {
              break label642;
            }
            d9 = localv == null ? d3 : paramf.a((v)localObject2);
            if (!bool2)
            {
              if (!paramBoolean2) {
                break;
              }
              localz2.h((v)localObject2);
            }
            if (!bool2)
            {
              if (i == 0)
              {
                locala_4 = (a_)((v)localObject2).c();
                locala_4.b = (d9 - this.b);
                locala_4.c = (paramf.b((v)localObject2) - this.d);
              }
              localz3.a((v)localObject2);
            }
          } while (!bool1);
          a_ locala_4 = a_.a(paramf.b((v)localObject2) - d1, d9 - d2, paramf.c((v)localObject2));
          locala_4.a = localz3.b(locala_4);
        } while (!bool1);
        label630:
        if (!bool2) {
          if ((i == 0) || (localObject1 == null)) {}
        }
        label642:
        while (bool2)
        {
          do
          {
            localObject2 = (a_)((v)localObject1).c();
            localObject2.c += this.d - paramf.d;
            localObject2.b += this.b - paramf.b;
            localObject1 = ((v)localObject1).a();
            if ((!bool2) && (bool1)) {
              break;
            }
          } while (!bool1);
          localz3.a(localz1);
          this.c = localz3;
          this.d = d1;
        }
        this.b = d2;
        return;
      }
    }
    a_ locala_1;
    a_ locala_2;
    if (!bool2) {
      if (a(d4, d5))
      {
        locala_1 = a_.a(d4, a((v)localObject1), c((v)localObject1));
        locala_2 = a_.a(d4, paramf.a(localv), paramf.c(localv));
        if ((!bool2) && (!bool1)) {
          break label1515;
        }
      }
    }
    Object localObject3;
    Object localObject4;
    if ((bool2) || (d4 < d5))
    {
      if ((bool2) || ((i != 0) || (Math.abs(d4 - d5) < Math.abs(d6 - d5))))
      {
        localObject2 = localObject1;
        if (!bool2)
        {
          if (i != 0)
          {
            localObject3 = (a_)((v)localObject2).c();
            localObject3.c += this.d - paramf.d;
            localObject3.b += this.b - paramf.b;
          }
          localObject1 = ((v)localObject1).a();
          localz1.h((v)localObject2);
          localz3.a((v)localObject2);
        }
        localObject3 = localz1.g();
        if (localObject1 != localObject3) {}
        do
        {
          if (!bool2)
          {
            if (b((v)localObject1) < d5) {
              localObject2 = localObject1;
            }
          }
          else
          {
            if (!bool2)
            {
              if (i != 0)
              {
                localObject4 = (a_)((v)localObject2).c();
                localObject4.c += this.d - paramf.d;
                localObject4.b += this.b - paramf.b;
              }
              localObject1 = ((v)localObject1).a();
              localz1.h((v)localObject2);
              localz3.a((v)localObject2);
            }
            if (!bool1) {
              break;
            }
          }
          localObject4 = localz3.g();
        } while (bool2);
        locala_1 = a_.a(d5, i != 0 ? paramf.a((v)localObject4, d5) : a((v)localObject4, d5), c((v)localObject4));
        if (!bool2) {
          if (!bool1) {
            break label1254;
          }
        }
      }
      else
      {
        localz3.a(localz1);
        localObject1 = localz3.g();
        localObject2 = localObject1;
        localObject1 = ((v)localObject1).b();
        localz3.h((v)localObject2);
        localz1.b((v)localObject2);
      }
      localObject3 = localz3.f();
      if (localObject1 != localObject3) {
        if (!bool2)
        {
          if (b((v)localObject1) < d5) {
            break label1217;
          }
          localObject2 = localObject1;
          localObject1 = ((v)localObject1).b();
        }
      }
      label1217:
      do
      {
        localz3.h((v)localObject2);
        localz1.b((v)localObject2);
        if (!bool1) {
          break;
        }
        localObject1 = localObject2;
        localObject4 = localz3.g();
      } while (bool2);
      locala_1 = a_.a(d5, a((v)localObject4, d5), c((v)localObject4));
      label1254:
      locala_2 = a_.a(paramf.b(localv), paramf.a(localv), paramf.c(localv));
      if (!bool1) {}
    }
    else
    {
      localObject2 = localz2.g();
      while ((localv != localObject2) && (paramf.b(localv) < d4))
      {
        localObject3 = localv;
        localv = localv.a();
        if (!bool2)
        {
          if (paramBoolean2) {
            localz2.h((v)localObject3);
          }
        }
        else
        {
          if (!bool2)
          {
            if (i == 0)
            {
              localObject4 = (a_)((v)localObject3).c();
              ((a_)localObject4).b = (paramf.a((v)localObject3) - this.b);
              ((a_)localObject4).c = (paramf.b((v)localObject3) - this.d);
            }
            localz3.a((v)localObject3);
          }
          if (!bool1) {
            continue;
          }
        }
        localObject4 = a_.a(paramf.b((v)localObject3) - d1, paramf.a((v)localObject3) - d2, paramf.c((v)localObject3));
      }
      do
      {
        ((a_)localObject4).a = localz3.b(localObject4);
        if (!bool1) {
          break;
        }
        localObject3 = localz3.g();
        localObject4 = (a_)((v)localObject3).c();
        locala_1 = a_.a(d4, a((v)localObject1, d4), c((v)localObject1));
      } while (bool2);
      locala_2 = a_.a(d4, ((a_)localObject4).a(d4 - d1) + d2, c((a_)localObject4));
    }
    label1515:
    double d8 = Math.max(d4, d5);
    double d10 = locala_1.a(d8);
    double d11 = locala_2.a(d8);
    label1679:
    label1688:
    label1695:
    label1836:
    label1838:
    label1888:
    label1905:
    label1916:
    do
    {
      double d12;
      double d17;
      double d18;
      do
      {
        Object localObject7;
        int j;
        Object localObject9;
        do
        {
          do
          {
            Object localObject8;
            do
            {
              if (localObject1 == null) {
                break label2490;
              }
              if (bool1) {
                break label2497;
              }
              if (localv == null) {
                break label2490;
              }
              d12 = d8;
              localObject7 = null;
              j = 0;
              double d13 = b((v)localObject1);
              if (!bool2) {
                if (d13 == d12)
                {
                  locala_1.c = d12;
                  locala_1.b = a((v)localObject1);
                  locala_1.d = c((v)localObject1);
                  localObject7 = localObject1;
                  localObject1 = ((v)localObject1).a();
                  localz1.h((v)localObject7);
                  j = 1;
                  if (!bool2)
                  {
                    if (localObject1 == null)
                    {
                      locala_1.b = d3;
                      d8 = 1.7976931348623157E+308D;
                    }
                  }
                  else
                  {
                    if (bool2) {
                      break label1688;
                    }
                    if (!bool1) {
                      break label1679;
                    }
                  }
                  d8 = b((v)localObject1);
                  d10 = locala_1.a(d12);
                  break label1695;
                }
              }
              d8 = d13;
              double d14 = paramf.b(localv);
              if (!bool2) {
                if (d14 == d12)
                {
                  locala_2.c = d12;
                  locala_2.b = paramf.a(localv);
                  locala_2.d = paramf.c(localv);
                  if (!bool2)
                  {
                    if (localObject7 == null) {
                      localObject7 = localv;
                    }
                  }
                  else
                  {
                    if (bool2) {
                      break label1838;
                    }
                    localv = localv.a();
                    if (!paramBoolean2) {
                      break label1836;
                    }
                    localz2.h((v)localObject7);
                    j = 1;
                    if ((!bool2) && (!bool1)) {
                      break label1836;
                    }
                  }
                  if (paramBoolean2)
                  {
                    localObject8 = localv;
                    if (bool2) {
                      break label1838;
                    }
                    localv = localv.a();
                    localz2.h((v)localObject8);
                    if (!bool1) {}
                  }
                  else
                  {
                    localv = localv.a();
                  }
                  if (localv == null)
                  {
                    locala_2.b = d3;
                    locala_2.d = 0.0D;
                    if (bool2) {
                      break label1888;
                    }
                    if (!bool1) {}
                  }
                  else
                  {
                    d8 = Math.min(d8, paramf.b(localv));
                  }
                  d11 = locala_2.a(d12);
                  if (bool2) {
                    break label1916;
                  }
                  if (!bool1) {
                    break label1905;
                  }
                }
              }
              d8 = Math.min(d8, d14);
              if (bool2) {
                break label2040;
              }
              if (d8 != 1.7976931348623157E+308D) {
                break label2038;
              }
              if (bool2) {
                break label2040;
              }
              if (d6 == 1.7976931348623157E+308D) {
                break label2038;
              }
              localObject8 = (a_)((v)localObject7).c();
              if (!bool2)
              {
                if (j == 0) {
                  break;
                }
                ((a_)localObject8).c = (d12 - d1);
                ((a_)localObject8).b = (d3 - d2);
                if (bool2) {
                  break label2019;
                }
                ((a_)localObject8).d = 0.0D;
                localz3.a((v)localObject7);
              }
            } while (!bool1);
            if (bool2) {
              break label2040;
            }
            a_ locala_5 = a_.a(((a_)localObject8).c, ((a_)localObject8).b, ((a_)localObject8).d);
            locala_5.a = localz3.b(locala_5);
          } while (!bool1);
          double d15 = d10;
          double d16 = d11;
          d10 = locala_1.a(d8);
          d11 = locala_2.a(d8);
          if (!bool2) {
            if (paramBoolean1)
            {
              if (bool2) {
                break label2109;
              }
              if (d15 >= d16) {
                break label2108;
              }
            }
          }
          if ((bool2) || (!paramBoolean1)) {
            if (bool2) {}
          }
          int k = d15 <= d16 ? 1 : 0;
          if (!bool2) {
            if (paramBoolean1)
            {
              if (bool2) {
                break label2160;
              }
              if (d10 >= d11) {
                break label2159;
              }
            }
          }
          if ((bool2) || (!paramBoolean1)) {
            if (bool2) {}
          }
          int m = d10 <= d11 ? 1 : 0;
          int n;
          if (!bool2) {
            if (k == m)
            {
              n = k;
              if (bool2) {
                break label2286;
              }
              if (!bool1) {
                break label2284;
              }
            }
          }
          if (!bool2) {
            if (a(d15, d16))
            {
              n = m;
              if (bool2) {
                break label2286;
              }
              if (!bool1) {
                break label2284;
              }
            }
          }
          if ((bool2) || (a(d10, d11)))
          {
            n = k;
            if (bool2) {
              break label2286;
            }
            if (!bool1) {}
          }
          else
          {
            w localw = a(locala_1, locala_2);
            d8 = localw.a();
            d10 = localw.b();
            d11 = localw.b();
            n = k;
          }
          d17 = n != 0 ? locala_1.d : locala_2.d;
          d18 = n != 0 ? d15 : d16;
          localObject9 = (bool2) || (!localz3.isEmpty()) ? (a_)localz3.d() : null;
        } while (((bool2) || (localObject9 != null)) && ((!bool2) && ((localObject9.d == d17) && (a(localObject9.a(d12 - d1) + d2, d18)))));
        if ((localObject7 == null) || (j == 0)) {
          break;
        }
        locala_6 = (a_)((v)localObject7).c();
        locala_6.c = (d12 - d1);
        locala_6.b = (d18 - d2);
        locala_6.d = d17;
        localz3.a((v)localObject7);
        if (bool2) {
          break label2487;
        }
      } while (!bool1);
      a_ locala_6 = a_.a(d12 - d1, d18 - d2, d17);
      locala_6.a = localz3.b(locala_6);
    } while (!bool1);
    label2019:
    label2038:
    label2040:
    if ((!bool2) && (localObject1 != null)) {
      if (!bool2)
      {
        if (i != 0) {
          break label2522;
        }
        localz3.a(localz1);
      }
    }
    label2108:
    label2109:
    label2159:
    label2160:
    do
    {
      Object localObject5;
      do
      {
        if ((bool1) && (localObject1 != null)) {
          break label2616;
        }
        while (bool2)
        {
          localObject5 = (a_)((v)localObject1).c();
          localObject5.c += this.d - paramf.d;
          localObject5.b += this.b - paramf.b;
          localObject6 = localObject1;
          localObject1 = ((v)localObject1).a();
          localz1.h((v)localObject6);
          localz3.a((v)localObject6);
          if ((!bool2) && (bool1)) {
            break label2770;
          }
          if (!bool1) {
            break;
          }
        }
        if (localv == null) {
          break label2770;
        }
        localObject5 = localv;
        localv = localv.a();
        if (bool1) {
          break label2777;
        }
        if (!paramBoolean2) {
          break;
        }
        localz2.h((v)localObject5);
        if (!bool2)
        {
          if (i == 0)
          {
            localObject6 = (a_)((v)localObject5).c();
            localObject6.c += paramf.d - this.d;
            localObject6.b += paramf.b - this.b;
          }
          localz3.a((v)localObject5);
        }
      } while (!bool1);
      Object localObject6 = a_.a(paramf.b((v)localObject5) - d1, paramf.a((v)localObject5) - d2, paramf.c((v)localObject5));
      ((a_)localObject6).a = localz3.b(localObject6);
    } while (!bool1);
    label2284:
    label2286:
    if (!bool2)
    {
      if (i != 0)
      {
        this.d = paramf.d;
        this.b = paramf.b;
      }
      this.c = localz3;
    }
    label2487:
    label2490:
    label2497:
    label2522:
    return;
  }
  
  private static boolean a(double paramDouble1, double paramDouble2)
  {
    if (!w.e) {}
    return Math.abs(paramDouble1 - paramDouble2) < 0.001D;
  }
  
  private double a(v paramv)
  {
    return a((a_)paramv.c());
  }
  
  private double b(v paramv)
  {
    return b((a_)paramv.c());
  }
  
  private double c(v paramv)
  {
    return c((a_)paramv.c());
  }
  
  private double d(v paramv)
  {
    if (!w.e) {
      if (paramv.a() == null) {
        throw new IllegalArgumentException("Cell is unbound!");
      }
    }
    return ((a_)paramv.a().c()).c + this.d;
  }
  
  private v d(double paramDouble)
  {
    boolean bool2 = w.e;
    boolean bool1 = w.d;
    v localv = this.c.f();
    double d1 = ((a_)localv.c()).c;
    double d2 = ((a_)this.c.d()).c;
    paramDouble -= this.d;
    if ((bool2) || (paramDouble >= d1))
    {
      if (bool2) {
        break label87;
      }
      if (paramDouble <= d2) {}
    }
    else
    {
      return null;
    }
    if (!bool2) {
      if (paramDouble == d2) {
        label87:
        return this.c.g();
      }
    }
    double d3 = ((a_)localv.a().c()).c;
    if (paramDouble >= d3) {
      localv = localv.a();
    }
    while (bool2)
    {
      if ((!bool2) && (bool1)) {
        break label161;
      }
      d3 = ((a_)localv.a().c()).c;
      if (!bool1) {
        break;
      }
    }
    label161:
    return localv;
  }
  
  public double a(a_ parama_)
  {
    return this.b + parama_.b;
  }
  
  public double b(a_ parama_)
  {
    return parama_.c + this.d;
  }
  
  public double c(a_ parama_)
  {
    return parama_.d;
  }
  
  public a_ e(double paramDouble)
  {
    v localv = d(paramDouble);
    return (w.e) || (localv != null) ? (a_)localv.c() : null;
  }
  
  public double d(a_ parama_)
  {
    if (!w.e) {
      if (parama_.a.a() == null) {
        throw new IllegalArgumentException("Segment is unbound!");
      }
    }
    return ((a_)parama_.a.a().c()).c + this.d;
  }
  
  public a_ e()
  {
    v localv = this.c.f();
    return (w.e) || (localv != null) ? (a_)localv.c() : null;
  }
  
  public a_ f()
  {
    v localv = this.c.g().b();
    return (a_)localv.c();
  }
  
  public a_ e(a_ parama_)
  {
    if ((w.e) || (parama_.a.b() != null)) {
      return (a_)parama_.a.b().c();
    }
    return null;
  }
  
  public a_ f(a_ parama_)
  {
    if ((w.e) || (parama_.a.a() != this.c.g())) {
      return (a_)parama_.a.a().c();
    }
    return null;
  }
  
  public double b(double paramDouble1, double paramDouble2)
  {
    boolean bool2 = w.e;
    boolean bool1 = w.d;
    double d1 = a();
    double d2 = b();
    double d3 = paramDouble1;
    double d4 = paramDouble2;
    if (!bool2) {
      if (d2 > d1)
      {
        if (bool2) {
          break label62;
        }
        if (d4 > d3) {
          break label58;
        }
      }
    }
    return 1.7976931348623157E+308D;
    label58:
    label62:
    double d5 = Math.max(d1, d3);
    double d6 = Math.min(d2, d4);
    if (!bool2) {
      if (d5 >= d6) {
        return -1.797693134862316E+308D;
      }
    }
    double d7 = d5;
    if (!bool2) {
      if (d1 == d3)
      {
        locala_ = e();
        if ((!bool2) && (!bool1)) {
          break label158;
        }
      }
    }
    if (d1 < d3)
    {
      if (bool2) {
        break label156;
      }
      locala_ = e(d7);
      if (!bool1) {
        break label158;
      }
    }
    label156:
    a_ locala_ = e();
    label158:
    double d8 = locala_.a(d5 - this.d) + this.b;
    d7 = d(locala_);
    if (!bool2) {
      if (d7 < d6) {
        locala_ = f(locala_);
      }
    }
    do
    {
      do
      {
        if (d7 >= d6) {
          break;
        }
        if (locala_ == this.c.d()) {
          break;
        }
        d8 = Math.max(d8, a(locala_));
        d8 = Math.max(d8, a(locala_, d(locala_)));
        d7 = d(locala_);
        if (!bool2)
        {
          if (d7 >= d6) {
            break;
          }
          locala_ = f(locala_);
        }
      } while (!bool1);
      d8 = Math.max(d8, locala_.a(d6 - this.d) + this.b);
    } while (bool2);
    return d8;
  }
  
  public double c(double paramDouble1, double paramDouble2)
  {
    boolean bool2 = w.e;
    boolean bool1 = w.d;
    double d1 = a();
    double d2 = b();
    double d3 = paramDouble1;
    double d4 = paramDouble2;
    if (!bool2) {
      if (d2 > d1)
      {
        if (bool2) {
          break label62;
        }
        if (d4 > d3) {
          break label58;
        }
      }
    }
    return 1.7976931348623157E+308D;
    label58:
    label62:
    double d5 = Math.max(d1, d3);
    double d6 = Math.min(d2, d4);
    if (!bool2) {
      if (d5 >= d6) {
        return 1.7976931348623157E+308D;
      }
    }
    double d7 = d5;
    if (!bool2) {
      if (d1 == d3)
      {
        locala_ = e();
        if ((!bool2) && (!bool1)) {
          break label158;
        }
      }
    }
    if (d1 < d3)
    {
      if (bool2) {
        break label156;
      }
      locala_ = e(d7);
      if (!bool1) {
        break label158;
      }
    }
    label156:
    a_ locala_ = e();
    label158:
    double d8 = locala_.a(d5 - this.d) + this.b;
    d7 = d(locala_);
    if (!bool2) {
      if (d7 < d6) {
        locala_ = f(locala_);
      }
    }
    do
    {
      do
      {
        if (d7 >= d6) {
          break;
        }
        if (locala_ == this.c.d()) {
          break;
        }
        d8 = Math.min(d8, a(locala_));
        d8 = Math.min(d8, a(locala_, d(locala_)));
        d7 = d(locala_);
        if (!bool2)
        {
          if (d7 >= d6) {
            break;
          }
          locala_ = f(locala_);
        }
      } while (!bool1);
      d8 = Math.min(d8, locala_.a(d6 - this.d) + this.b);
    } while (bool2);
    return d8;
  }
  
  public double f(f paramf)
  {
    boolean bool2 = w.e;
    boolean bool1 = w.d;
    double d1 = a();
    double d2 = paramf.a();
    double d3 = b();
    double d4 = paramf.b();
    if (!bool2) {
      if (d3 > d1)
      {
        if (bool2) {
          break label65;
        }
        if (d4 > d2) {
          break label62;
        }
      }
    }
    return 1.7976931348623157E+308D;
    label62:
    label65:
    double d5 = Math.max(d1, d2);
    double d6 = Math.min(d3, d4);
    if (!bool2) {
      if (d5 >= d6) {
        return 1.7976931348623157E+308D;
      }
    }
    double d7 = d5;
    a_ locala_1;
    if (!bool2) {
      if (d1 == d2)
      {
        locala_1 = e();
        locala_2 = paramf.e();
        if ((!bool2) && (!bool1)) {
          break label179;
        }
      }
    }
    if (d1 < d2)
    {
      locala_1 = e(d7);
      locala_2 = paramf.e();
      if (!bool2) {
        if (!bool1) {
          break label179;
        }
      }
    }
    else
    {
      locala_1 = e();
    }
    a_ locala_2 = paramf.e(d7);
    label179:
    double d8 = 1.7976931348623157E+308D;
    label300:
    label337:
    do
    {
      do
      {
        do
        {
          do
          {
            do
            {
              if (d7 >= d6) {
                break label373;
              }
              d8 = Math.min(d8, paramf.a(locala_2, d7) - a(locala_1, d7));
              if (bool2) {
                break label337;
              }
              if (paramf.d(locala_2) >= d(locala_1)) {
                break label300;
              }
              d7 = paramf.d(locala_2);
              d8 = Math.min(d8, paramf.a(locala_2, d7) - a(locala_1, d7));
              if (bool2) {
                break;
              }
            } while (d7 >= d6);
            locala_2 = paramf.f(locala_2);
            if (bool2) {
              break label337;
            }
          } while (!bool1);
          d7 = d(locala_1);
          d8 = Math.min(d8, paramf.a(locala_2, d7) - a(locala_1, d7));
        } while (d7 >= d6);
        locala_1 = f(locala_1);
        if ((bool2) || ((!bool2) && (bool1))) {
          break label397;
        }
      } while (bool2);
    } while (!bool1);
    label373:
    d8 = Math.min(d8, paramf.a(locala_2, d7) - a(locala_1, d7));
    label397:
    return d8;
  }
  
  public String toString()
  {
    boolean bool2 = w.e;
    boolean bool1 = w.d;
    StringBuffer localStringBuffer = new StringBuffer(this.c.size() * 20);
    do
    {
      for (a_ locala_ = (a_)this.c.a(); !bool1; locala_ = f(locala_))
      {
        if (locala_ == null) {
          break;
        }
        if (bool1) {
          break label127;
        }
        localStringBuffer.append("Segment [").append(locala_.c + this.d).append(" - ").append(locala_.a() + this.d).append("], value=").append(locala_.b + this.b).append(", slope=").append(locala_.d);
      }
    } while (bool2);
    label127:
    return localStringBuffer.toString();
  }
  
  public void a(double paramDouble1, double paramDouble2, boolean paramBoolean)
  {
    boolean bool2 = w.e;
    boolean bool1 = w.d;
    v localv = this.c.f();
    a_ locala_1 = (a_)localv.c();
    if (!bool2) {
      if (paramBoolean)
      {
        if (bool2) {
          break label98;
        }
        if (locala_1.d > 0.0D) {
          break label79;
        }
      }
    }
    if (!bool2) {
      if (!paramBoolean)
      {
        if (bool2) {
          break label150;
        }
        if (locala_1.d < 0.0D)
        {
          label79:
          label98:
          localObject1 = a_.a(d(locala_1) - paramDouble1, locala_1.a(d(locala_1)), 0.0D);
          ((a_)localObject1).a = this.c.b(localObject1, localv);
          if (bool2) {
            break label266;
          }
          localv = localv.a();
          locala_1.c -= paramDouble1;
          if (!bool1) {
            break label264;
          }
        }
      }
    }
    label150:
    if (!bool2) {
      if (paramBoolean)
      {
        if (bool2) {
          break label210;
        }
        if (locala_1.d < 0.0D) {
          break label198;
        }
      }
    }
    if (!bool2)
    {
      if (!paramBoolean) {
        if (bool2) {
          break label255;
        }
      }
    }
    else if (locala_1.d > 0.0D)
    {
      label198:
      label210:
      localObject1 = a_.a(locala_1.c - paramDouble1, locala_1.b, 0.0D);
      ((a_)localObject1).a = this.c.a(localObject1, localv);
      if (bool2) {
        break label261;
      }
      locala_1.c += paramDouble2;
      if (!bool1) {
        break label264;
      }
    }
    label255:
    locala_1.c -= paramDouble1;
    label261:
    label264:
    label266:
    Object localObject1 = localv;
    Object localObject2 = ((v)localObject1).a();
    if (((v)localObject2).a() != null) {}
    a_ locala_2;
    label408:
    label415:
    label623:
    label889:
    while (bool2)
    {
      localObject3 = (a_)((v)localObject2).c();
      if (bool1) {
        break label1241;
      }
      locala_2 = (a_)((v)localObject1).c();
      if (!bool2) {
        if (paramBoolean)
        {
          if (bool2) {
            break label415;
          }
          if (((a_)localObject3).b > locala_2.a(d(locala_2))) {
            break label408;
          }
          if (bool2) {
            break label415;
          }
          if (((a_)localObject3).d > 0.0D) {
            break label408;
          }
        }
      }
      a_ locala_3;
      if (!bool2) {
        if (!paramBoolean)
        {
          if (!bool2) {
            if (((a_)localObject3).b >= locala_2.a(d(locala_2)))
            {
              if (bool2) {
                break label1054;
              }
              if (((a_)localObject3).d >= 0.0D) {
                break label1052;
              }
            }
          }
          if (!bool2)
          {
            if (((a_)localObject3).d != 0.0D)
            {
              locala_3 = a_.a(d((a_)localObject3) - paramDouble1, ((a_)localObject3).a(d((a_)localObject3)), 0.0D);
              locala_3.a = this.c.b(locala_3, (v)localObject2);
              localObject2 = ((v)localObject2).a();
            }
            localObject3.c -= paramDouble1;
          }
          if (!bool2) {
            if (((a_)localObject3).c == locala_2.c)
            {
              this.c.h((v)localObject1);
              if (bool2) {
                break label1223;
              }
              if (!bool1) {
                break label1210;
              }
            }
          }
          if (bool2) {
            break label1223;
          }
          if (((a_)localObject3).c >= locala_2.c) {
            break label1210;
          }
          locala_3 = locala_2.b();
          if (!bool2) {
            if (((a_)localObject3).d == 0.0D)
            {
              if (bool2) {
                break label623;
              }
              if (locala_3.d == 0.0D)
              {
                if (bool2) {
                  break label1044;
                }
                if (locala_3.b < ((a_)localObject3).b) {
                  break label1032;
                }
                ((a_)localObject3).c = locala_2.c;
                if (bool2) {
                  break label1044;
                }
                if (!bool1) {
                  break label1032;
                }
              }
            }
          }
          double d1;
          if (!bool2) {
            if (locala_3.d == 0.0D)
            {
              if (!bool2) {
                if (paramBoolean)
                {
                  if (bool2) {
                    break label714;
                  }
                  if (locala_3.b < ((a_)localObject3).a(locala_2.c)) {
                    break label699;
                  }
                }
              }
              if (!bool2)
              {
                if (!paramBoolean)
                {
                  if (bool2) {
                    break label783;
                  }
                  if (locala_3.b > ((a_)localObject3).a(locala_2.c))
                  {
                    d1 = ((a_)localObject3).a(locala_2.c) - locala_3.b;
                    ((a_)localObject3).c = (locala_2.c - d1 / ((a_)localObject3).d);
                    ((a_)localObject3).b = locala_3.b;
                    if (bool2) {
                      break label1044;
                    }
                    if (!bool1) {
                      break label1032;
                    }
                  }
                }
                ((a_)localObject3).b = ((a_)localObject3).a(locala_2.c);
                ((a_)localObject3).c = locala_2.c;
              }
              if (bool2) {
                break label1044;
              }
              if (!bool1) {
                break label1032;
              }
            }
          }
          if (!bool2) {
            if (((a_)localObject3).d == 0.0D)
            {
              if (!bool2) {
                if (paramBoolean)
                {
                  if (bool2) {
                    break label889;
                  }
                  if (locala_3.a(((a_)localObject3).c) > ((a_)localObject3).b) {
                    break label874;
                  }
                }
              }
              if (bool2) {
                break label1044;
              }
              if (paramBoolean) {
                break label1032;
              }
              if (bool2) {
                break label1044;
              }
              if (locala_3.a(((a_)localObject3).c) >= ((a_)localObject3).b) {
                break label1032;
              }
              d1 = locala_3.a(((a_)localObject3).c) - ((a_)localObject3).b;
              ((a_)localObject3).c -= d1 / ((a_)localObject3).d;
              if (bool2) {
                break label1044;
              }
              if (!bool1) {
                break label1032;
              }
            }
          }
          if (!bool2) {
            if (!paramBoolean)
            {
              if (bool2) {
                break label963;
              }
              if (locala_3.d > 0.0D)
              {
                if (bool2) {
                  break label1011;
                }
                if (((a_)localObject3).d < 0.0D) {
                  break label1001;
                }
              }
            }
          }
          if (!bool2)
          {
            if (paramBoolean)
            {
              if (bool2) {
                break label1044;
              }
              if (locala_3.d < 0.0D)
              {
                if (bool2) {
                  break label1044;
                }
                if (((a_)localObject3).d > 0.0D)
                {
                  d1 = a((a_)localObject3, locala_3).a();
                  ((a_)localObject3).b = ((a_)localObject3).a(d1);
                  ((a_)localObject3).c = d1;
                }
              }
            }
            this.c.h((v)localObject1);
          }
          if (bool2) {
            break label1223;
          }
          if (!bool1) {
            break label1210;
          }
        }
      }
      if (!bool2) {
        if (paramBoolean)
        {
          if (bool2) {
            break label1164;
          }
          if (((a_)localObject3).b < locala_2.a(d(locala_2))) {
            break label1152;
          }
          if (bool2) {
            break label1164;
          }
          if (((a_)localObject3).d < 0.0D) {
            break label1152;
          }
        }
      }
      if (!bool2)
      {
        if (!paramBoolean)
        {
          if (!bool2)
          {
            if (((a_)localObject3).b <= locala_2.a(d(locala_2)))
            {
              if (bool2) {
                break label1223;
              }
              if (((a_)localObject3).d <= 0.0D) {
                break label1210;
              }
            }
            if (bool2) {}
          }
          else if (((a_)localObject3).d != 0.0D)
          {
            locala_3 = a_.a(((a_)localObject3).c, ((a_)localObject3).b, 0.0D);
            locala_3.a = this.c.a(locala_3, (v)localObject2);
          }
          localObject3.c += paramDouble2;
        }
        localObject1 = localObject2;
        localObject2 = ((v)localObject2).a();
      }
      if (!bool1) {
        break;
      }
    }
    label699:
    label714:
    label874:
    label1011:
    localObject2 = (a_)this.c.d();
    label783:
    label963:
    label1001:
    localObject2.c += paramDouble2;
    label1032:
    label1044:
    label1052:
    label1054:
    label1210:
    label1223:
    label1241:
    localObject1 = this.c.f();
    label1152:
    label1164:
    localObject2 = (a_)((v)localObject1).c();
    Object localObject3 = ((v)localObject1).a();
    label1375:
    do
    {
      if (localObject3 == null) {
        break;
      }
      locala_2 = (a_)((v)localObject3).c();
      if (!bool2)
      {
        if (locala_2.d == ((a_)localObject2).d)
        {
          if (bool2) {
            break label1375;
          }
          if (locala_2.b == ((a_)localObject2).a(d((a_)localObject2)))
          {
            this.c.h((v)localObject3);
            if (bool2) {
              continue;
            }
            if (!bool1) {
              break label1412;
            }
          }
        }
        if (bool2) {
          break label1410;
        }
      }
      if (locala_2.c == ((a_)localObject2).c)
      {
        this.c.h((v)localObject1);
        if (bool2) {
          continue;
        }
        if (!bool1) {}
      }
      else
      {
        localObject1 = localObject3;
        localObject2 = (a_)((v)localObject1).c();
      }
      localObject3 = ((v)localObject3).a();
    } while (!bool1);
    label1410:
    label1412:
    return;
  }
  
  public static class a_
  {
    v a;
    double b;
    double c;
    double d;
    public static boolean e;
    
    a_(double paramDouble1, double paramDouble2, double paramDouble3)
    {
      this.c = paramDouble1;
      this.b = paramDouble2;
      this.d = paramDouble3;
    }
    
    static a_ a(double paramDouble1, double paramDouble2, double paramDouble3)
    {
      return new a_(paramDouble1, paramDouble2, paramDouble3);
    }
    
    public double a(double paramDouble)
    {
      boolean bool = w.e;
      if (!bool) {
        if (paramDouble != this.c)
        {
          if (bool) {
            break label43;
          }
          if (this.d != 0.0D) {
            break label38;
          }
        }
      }
      return this.b;
      label38:
      label43:
      double d1 = paramDouble - this.c;
      return this.b + d1 * this.d;
    }
    
    public double a()
    {
      v localv = this.a.a();
      if (!w.e) {
        if (localv == null) {
          return 1.7976931348623157E+308D;
        }
      }
      return ((a_)localv.c()).c;
    }
    
    public final a_ b()
    {
      if ((w.e) || (this.a.b() != null)) {
        return (a_)this.a.b().c();
      }
      return null;
    }
    
    public final a_ c()
    {
      boolean bool = w.e;
      if (((bool) || (this.a.a() != null)) && ((bool) || (this.a.a().a() != null))) {
        return (a_)this.a.a().c();
      }
      return null;
    }
    
    public String toString()
    {
      return "Segment [" + this.c + " - " + a() + "], value=" + this.b + ", slope=" + this.d;
    }
  }
}


/* Location:           E:\idea\
 * Qualified Name:     a.d.f
 * JD-Core Version:    0.7.0.1
 */